package com.cleaningcloud.cld.controller.mini;

import com.cleaningcloud.cld.domain.CldEvaluate;
import com.cleaningcloud.cld.domain.vo.CldRevisitVo;
import com.cleaningcloud.cld.service.mini.IMiniRevisitService;
import com.cleaningcloud.common.core.web.controller.BaseController;
import com.cleaningcloud.common.core.web.domain.AjaxResult;
import com.cleaningcloud.common.core.web.page.TableDataInfo;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * packageName com.cleaningcloud.cld.controller.mini
 *
 * @author Shaw
 * @version JDK 8
 * @className MiniEvaluateController
 * @date 2025-06-18
 * @description 客户回访
 */
@RestController
@RequestMapping("/mini/revisit")
public class MiniRevisitController extends BaseController {

    @Autowired
    IMiniRevisitService miniRevisitService;

    /**
     * @Author Shaw
     * @Description 查询客户回访列表信息
     * @date: 2025-06-20 15:51
     * @param: //TODO
     */
    @Operation(description = "获取客户回访列表")
    @GetMapping("/getCldRevisitList")
    public TableDataInfo getCldRevisitList(CldRevisitVo cldRevisitVo) {
        startPage();
        List<CldRevisitVo> list = miniRevisitService.getCldRevisitList(cldRevisitVo);
        return getMiniDataTable(list);
    }

    /**
     * @Author Shaw
     * @Description 查询客户回访详情信息
     * @date: 2025-06-18 9:39
     * @param: //TODO
     */
    @Operation(description = "查询客户回访详情")
    @GetMapping("/getCldRevisitInfo/{revisitId}")
    public AjaxResult getCldRevisitInfo(@PathVariable Long revisitId) {
        return success(miniRevisitService.getCldRevisitInfo(revisitId));
    }

    /**
     * @Author Shaw
     * @Description 客户回访评价
     * @date: 2025-06-18 9:39
     * @param: //TODO
     */
    @Operation(description = "客户回访评价")
    @PostMapping("/updateEvaluate")
    public AjaxResult updateEvaluate(@RequestBody CldRevisitVo cldRevisitVo) {
        return toAjax(miniRevisitService.updateEvaluate(cldRevisitVo));
    }
}